<?php
	
	$m = date('n',$data['stamp']);
	switch ($m) {
	  case 1:
	    $mes = "Janeiro";break;
	  case 2:
	    $mes = "Fevereiro";break;
	  case 3:
	    $mes = "Março";break;
	  case 4:
	    $mes = "Abril";break;
	  case 5:
	    $mes = "Maio"; break;
	  case 6:
	    $mes = "Junho";break;
	  case 7:
	    $mes = "Julho";break;
	  case 8:
	    $mes = "Agosto";break;
	  case 9:
	    $mes = "Setembro";break;
	  case 10:
	    $mes = "Outubro";break;
	  case 11:
	    $mes = "Novembro";break;
	  case 12:
	    $mes = "Dezembro";break;
	  default:
	    $mes = "";break;
	}
	
	echo "<h2 id='contentTitle'>".$pageTitle." - ".$mes." ".date('Y',$data['stamp'])."</h2>";
	
	echo $this->renderElement('message');

	if ($othAuth->hasPermission('events/add/')) {
		$addButton = "<span class=\"buttonAdd\">Cadastrar evento</span>";
		echo html_entity_decode($html->link($addButton, '/events/add/',array('class'=>'button')));
	}


	echo ($data['calendar_name'] ? '<h1>'.$data['calendar_name'].'</h1>' : '');
	echo ($data['tag_name'] ? '<h2>'.$data['tag_name'].'</h2>' : '');
	echo "<p>".$html->link('Mês anterior','/events/calendar/'.$prev)." | ".$mes." ".date('Y',$data['stamp'])." | ".$html->link('Mês seguinte','/events/calendar/'.$next)."</p>";

	echo "<div class='_calendar'";
	echo $this->renderElement('calendar',array('events'=>$events,'data'=>$data,'birthdays'=>$birthdays));
	echo "</div>";
	
	echo "<div class='_details'>";
	echo $this->renderElement('details',array('events'=>$events, 'birthdays'=>$birthdays));
	echo "</div>";